<template>
  <view>
    <button @click="onLoginTap">登录</button>
  </view>
</template>

<script setup lang="ts">
import { useUserInfoStore } from "@/stores/user";
import { storeToRefs } from "pinia";

const userStore = useUserInfoStore();
const { userInfo } = storeToRefs(userStore);

function onLoginTap() {
  const userResult = { token: "5pnRhZDL8rTvZpNTiFu52w==" };
  userStore.setUserInfo(userResult);
  uni.showToast({ title: "登录成功", icon: "success" });
}
</script>

<style lang="scss" scoped>
</style>
    
      